<template>
  <div class="banner">
    <van-swipe :autoplay="3000">
      <van-swipe-item v-for="(item, index) in bannerList" :key="index">
        <img :src="item.imgurl" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import {getBannerList} from "../../apis/home"
import Vue from "vue";
import { Swipe, SwipeItem,Lazyload } from "vant";
Vue.use(Lazyload);
Vue.use(Swipe);
Vue.use(SwipeItem);
export default {
  name: "Banner",

  data() {
    return {
      bannerList: [],
    };
  },

  mounted() {},

  methods: {},
  created () {
     getBannerList().then((data) => {
      // console.log(data)
      this.bannerList = data.data;
    });
  }
};
</script>

<style  scoped>
.banner{
  margin-top: .1rem;
    height: 1.80rem;
    width: 3.7;
   
}
.van-swipe{
  height: 100%;
  width: 100%;
}
.banner img{
    height: 100%;
    width: 100%;
    border-radius:.1rem ;
}
</style>